var config = require(path.resolve(process.env.npm_config_wm_root, './webpack/config'))
var HtmlWebpackPlugin = config.webpack.tools.HtmlWebpackPlugin // require('html-webpack-plugin')
var origWebpackBaseConfig = require('./webpack.base.conf')
var entries = Object.keys(origWebpackBaseConfig.entry)

module.exports = {
  plugins: [
    // https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: path.resolve(config.base.appSrcRoot, './index.html'),
      excludeChunks: entries.filter(function (x) { return x !== 'app' }),
      inject: true
    })
  ]
}
